import { createDuel } from './src/duel';

import huz from './cards/10000010.js';
import blue from './cards/10000011.js';
import silence from './cards/73665146.js';
import dzl from './cards/70095154.js';


const duel = createDuel('yami', '高原');

let myDesk = [ silence, blue, huz, huz, silence, silence ];

let enemyDesk = [
    {
        data: {
            id: '1232',
            name: '真红眼黑龙',
            level: 7,
            attack: 2400,
            defend: 2100,
            desc: 'im red',
            type: ['monster', 'tc']
        },
        init: function() {
            let drawEvent = this.createEvent('before-attack', function(caller, event) {
                console.log('我在被'+ caller.data.name +'攻击，请求支援！');
                this.removeEvent(event.name, event.symbol);
            });
            this.registEvent(drawEvent);
        }
    }, huz, huz, huz, huz, dzl
];


(async function() {
    duel.loadDesks(myDesk, enemyDesk);
    await duel.me.draw(2);
    await duel.me.summon(0, 1);
    await duel.enemy.draw(2);
    await duel.enemy.useHand(0);
})()